package com.example.aicooking.mapper;

import com.example.aicooking.entity.dto.IngredientDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IngredientMapper {
    @Select("SELECT i.ingredient_name, il.amount, il.unit " +
            "FROM ingredient i " +
            "JOIN ingredient_list il ON i.ingredient_id = il.ingredient_id " +
            "WHERE il.work_id = #{workId}")
    List<IngredientDTO> findIngredientsByWorkId(Integer workId);
}
